<template>
	<view class="container">
		<view class="dingwei" @click="gomap()">
			<map :latitude="latitude" :longitude="longitude" :markers="markers">
				<text style="color: black;">实时更新当前位置</text><br>
				<text class="small_1">定位监控</text>
			</map>
		</view>
		<view class="navtop">
			<view class="topleft" @click="mycall()">
				<image src="../../../static/img/kefuguanli.png" style="width: 50px;height: 50px;" mode=""></image>
				<view class="jieshi">
					<text>服务热线</text><br><text class="zhujie">7*24小时服务</text>
				</view>
			</view>
			<view class="topright" @click="mycall()">
				<image src="../../../static/img/anquanzhongxin.png" style="width: 50px;height: 50px;" mode=""></image>
				<view class="jieshi">
					<text>紧急救助</text><br><text class="zhujie">应急救护随叫随到</text>
				</view>
			</view>
		</view>
		<view class="function_all">
			<view class="function_1" @click="makeanappointment()">
				<image src="../../../static/img/wodedingdan.png" mode=""></image>
				<text>预约服务</text>
			</view>
			<view class="function_1" @click="goorder()">
				<image src="../../../static/img/biaoshu.png" mode=""></image>
				<text>订单管理</text>
			</view>
			<view class="function_1" @click="goarchives()">
				<image src="../../../static/img/tongxunlu.png" mode=""></image>
				<text>档案信息</text>
			</view>
			<view class="function_1" @click="healthtests()">
				<image src="../../../static/img/yiliao.png" mode=""></image>
				<text>健康检测</text>
			</view>
			<view class="function_1" @click="goMessage()">
				<image src="../../../static/img/liuyan.png" mode=""></image>
				<text>消息提醒</text>
			</view>
			<view class="function_1" @click="closeCon()">
				<image src="../../../static/img/guanbi.png" mode=""></image>
				<text>退出登录</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				longitude: 104.06667,
				latitude: 30.66667,
				scale: 16,
				markers: [{
					latitude: 30.66667,
					longitude: 104.06667,
					iconPath: "../../../static/img/marker-.png",
					width: 30,
					height: 30,
					callout: {
						display: "ALWAYS",
						content: " 我 ",
						padding: 5,
						color: "#fff",
						fontSize: 18,
						bgColor: "#3774EC",
						borderRadius: 5
					}
				}],
			}
		},
		methods: {
			healthtests() {
				uni.navigateTo({
					url: "../healthtexting/healthtexting"
				})
			},
			gomap() {
				uni.navigateTo({
					url: "../realtimepositioning/realtimepositioning"
				})
			},
			mycall() {
				uni.makePhoneCall({
					// 手机号
					phoneNumber: '13783712192',
					// 成功回调
					success: (res) => {
						console.log('调用成功!')
					},
					// 失败回调
					fail: (res) => {
						console.log('调用失败!')
						this.call_phone(); //重复调用一次
					}
				});
			},
			closeCon() {
				uni.reLaunch({
					url: "../../index/index"
				})
			},
			makeanappointment(){
				uni.navigateTo({
					url: "../../zhao/ReservationService/ReservationService"
				})
			},
			goorder(){
				uni.navigateTo({
					url: "../../zhao/ServiceManagement/ServiceManagement"
				})
			},
			goarchives(){
				uni.navigateTo({
					url: "../../zhao/ArchivesMessage/ArchivesMessage"
				})
			},
			goMessage(){
				uni.navigateTo({
					url: "../../zhao/message/message"
				})
			}
		}
	}
</script>

<style>
	.container {
		width: 100%;
		padding: 0;
		font-size: 18px;
		line-height: 24px;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.dingwei {
		width: 95%;
		height: 140px;
		background-size: 100% 100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		box-shadow: 2px 2px 5px #b3b3b3;
	}

	.dingwei>map {
		width: 100%;
		height: 100%;
	}

	.dingwei>map>text {
		z-index: 1;
		margin-left: 45%;
	}

	.small_1 {
		color: #e7ac34;
		font-size: 16px;
		border: 1px solid #e7ac34;
	}

	.navtop {
		width: 95%;
		margin-top: 10%;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		font-size: 12px;
	}

	.topleft {
		width: 48%;
		height: 50px;
		border: 1px solid #dddddd;
		border-radius: 5px;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		box-shadow: 2px 2px 5px #b3b3b3;
	}

	.topright {
		width: 48%;
		height: 50px;
		border: 1px solid #dddddd;
		border-radius: 5px;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		box-shadow: 2px 2px 5px #b3b3b3;
	}

	.jieshi {
		font-size: 16px;
	}

	.zhujie {
		font-size: 10px;
		color: #aaa9a9;
	}

	.function_all {
		width: 95%;
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-between;
	}

	.function_all image {
		width: 50px;
		height: 50px;
	}

	.function_1 {
		width: 30%;
		height: 150px;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
</style>
